
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>如何修改野火应用服务生成用户名的策略 · 野火IM开发手册</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="野火IM">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search-plus/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-prism/prism-base16-ateliersulphurpool.light.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-anchors/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-emphasize/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.css">
                
            
                
                <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-sectionx/sectionx.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-anchor-navigation-ex/style/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-terminal/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-alerts/style.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-navigator/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    

        
    
    
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="苹果ATS处理.html" />
    
    
    <link rel="prev" href="如何开发一款微信.html" />
    

    
        <link rel="shortcut icon" href='../favicon.ico' type="image/x-icon">
    
    
        <link rel="bookmark" href='../favicon.ico' type="image/x-icon">
    
    
    

    <style>
    @media only screen and (max-width: 640px) {
        .book-header .hidden-mobile {
            display: none;
        }
    }
    </style>
    <script>
        window["gitbook-plugin-github-buttons"] = {"repo":"wildfirechat/server","types":["star"],"size":"small"};
    </script>

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    
    
        
        <li>
            <a href="http://www.wildfirechat.cn" target="_blank" class="custom-link">Home</a>
        </li>
    
    

    
    <li class="divider"></li>
    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                        <b>1.1.</b>
                    
                    产品介绍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../quick_start/">
            
                <a href="../quick_start/">
            
                    
                        <b>1.2.</b>
                    
                    快速开始
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../quick_start/server.html">
            
                <a href="../quick_start/server.html">
            
                    
                        <b>1.2.1.</b>
                    
                    服务器部署
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../quick_start/android.html">
            
                <a href="../quick_start/android.html">
            
                    
                        <b>1.2.2.</b>
                    
                    安卓编译
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="../quick_start/iOS.html">
            
                <a href="../quick_start/iOS.html">
            
                    
                        <b>1.2.3.</b>
                    
                    iOS编译
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="../quick_start/pc.html">
            
                <a href="../quick_start/pc.html">
            
                    
                        <b>1.2.4.</b>
                    
                    PC体验
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../architecture/">
            
                <a href="../architecture/">
            
                    
                        <b>1.3.</b>
                    
                    系统架构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../base_knowledge/">
            
                <a href="../base_knowledge/">
            
                    
                        <b>1.4.</b>
                    
                    基础知识
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../base_knowledge/sdk_demo.html">
            
                <a href="../base_knowledge/sdk_demo.html">
            
                    
                        <b>1.4.1.</b>
                    
                    SDK与Demo的关系
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../base_knowledge/user.html">
            
                <a href="../base_knowledge/user.html">
            
                    
                        <b>1.4.2.</b>
                    
                    用户
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="../base_knowledge/sdk_abilities.html">
            
                <a href="../base_knowledge/sdk_abilities.html">
            
                    
                        <b>1.4.3.</b>
                    
                    SDK的功能
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="../base_knowledge/connect.html">
            
                <a href="../base_knowledge/connect.html">
            
                    
                        <b>1.4.4.</b>
                    
                    连接
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="../base_knowledge/conversation.html">
            
                <a href="../base_knowledge/conversation.html">
            
                    
                        <b>1.4.5.</b>
                    
                    会话
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.6" data-path="../base_knowledge/message.html">
            
                <a href="../base_knowledge/message.html">
            
                    
                        <b>1.4.6.</b>
                    
                    消息
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.7" data-path="../base_knowledge/message_content.html">
            
                <a href="../base_knowledge/message_content.html">
            
                    
                        <b>1.4.7.</b>
                    
                    消息内容
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.8" data-path="../base_knowledge/message_payload.html">
            
                <a href="../base_knowledge/message_payload.html">
            
                    
                        <b>1.4.8.</b>
                    
                    消息负载
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.9" data-path="../base_knowledge/storage_and_sync.html">
            
                <a href="../base_knowledge/storage_and_sync.html">
            
                    
                        <b>1.4.9.</b>
                    
                    存储与同步
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.10" data-path="../base_knowledge/offline_message.html">
            
                <a href="../base_knowledge/offline_message.html">
            
                    
                        <b>1.4.10.</b>
                    
                    离线消息
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.11" data-path="../base_knowledge/group.html">
            
                <a href="../base_knowledge/group.html">
            
                    
                        <b>1.4.11.</b>
                    
                    群组
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.12" data-path="../base_knowledge/chatroom.html">
            
                <a href="../base_knowledge/chatroom.html">
            
                    
                        <b>1.4.12.</b>
                    
                    聊天室
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.13" data-path="../base_knowledge/custom_message_content.html">
            
                <a href="../base_knowledge/custom_message_content.html">
            
                    
                        <b>1.4.13.</b>
                    
                    自定义消息内容
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../server/">
            
                <a href="../server/">
            
                    
                        <b>1.5.</b>
                    
                    服务器说明
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../server/server_port.html">
            
                <a href="../server/server_port.html">
            
                    
                        <b>1.5.1.</b>
                    
                    服务器端口说明
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../server/db_config.html">
            
                <a href="../server/db_config.html">
            
                    
                        <b>1.5.2.</b>
                    
                    数据库配置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="../server/server_memory.html">
            
                <a href="../server/server_memory.html">
            
                    
                        <b>1.5.3.</b>
                    
                    机器内存的选择
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4" data-path="../server/benchmark.html">
            
                <a href="../server/benchmark.html">
            
                    
                        <b>1.5.4.</b>
                    
                    性能测试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.5" data-path="../server/server_config.html">
            
                <a href="../server/server_config.html">
            
                    
                        <b>1.5.5.</b>
                    
                    服务器配置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.6" data-path="../server/admin_api/">
            
                <a href="../server/admin_api/">
            
                    
                        <b>1.5.6.</b>
                    
                    Server API接口
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.6.1" data-path="../server/admin_api/user_api.html">
            
                <a href="../server/admin_api/user_api.html">
            
                    
                        <b>1.5.6.1.</b>
                    
                    用户
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.6.2" data-path="../server/admin_api/user_relation.html">
            
                <a href="../server/admin_api/user_relation.html">
            
                    
                        <b>1.5.6.2.</b>
                    
                    用户关系
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.6.3" data-path="../server/admin_api/robot_api.html">
            
                <a href="../server/admin_api/robot_api.html">
            
                    
                        <b>1.5.6.3.</b>
                    
                    机器人
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.6.4" data-path="../server/admin_api/message_api.html">
            
                <a href="../server/admin_api/message_api.html">
            
                    
                        <b>1.5.6.4.</b>
                    
                    消息
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.6.5" data-path="../server/admin_api/group_api.html">
            
                <a href="../server/admin_api/group_api.html">
            
                    
                        <b>1.5.6.5.</b>
                    
                    群组
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.6.6" data-path="../server/admin_api/chatroom_api.html">
            
                <a href="../server/admin_api/chatroom_api.html">
            
                    
                        <b>1.5.6.6.</b>
                    
                    聊天室
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.6.7" data-path="../server/admin_api/sensitive_word_api.html">
            
                <a href="../server/admin_api/sensitive_word_api.html">
            
                    
                        <b>1.5.6.7.</b>
                    
                    敏感词
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.6.8" data-path="../server/admin_api/error_code.html">
            
                <a href="../server/admin_api/error_code.html">
            
                    
                        <b>1.5.6.8.</b>
                    
                    code状态码
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5.7" data-path="../server/sdk.html">
            
                <a href="../server/sdk.html">
            
                    
                        <b>1.5.7.</b>
                    
                    Server SDK
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.8" data-path="../server/robot_api/">
            
                <a href="../server/robot_api/">
            
                    
                        <b>1.5.8.</b>
                    
                    Robot API接口
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.9" data-path="../server/event_callback.html">
            
                <a href="../server/event_callback.html">
            
                    
                        <b>1.5.9.</b>
                    
                    事件回调
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.10" data-path="../server/push_config.html">
            
                <a href="../server/push_config.html">
            
                    
                        <b>1.5.10.</b>
                    
                    推送说明
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.11" data-path="../server/media_server.html">
            
                <a href="../server/media_server.html">
            
                    
                        <b>1.5.11.</b>
                    
                    媒体服务
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.12" data-path="../server/server_clean.html">
            
                <a href="../server/server_clean.html">
            
                    
                        <b>1.5.12.</b>
                    
                    服务的维护
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.13" data-path="../server/mysql_tune.html">
            
                <a href="../server/mysql_tune.html">
            
                    
                        <b>1.5.13.</b>
                    
                    MySQL调优
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.14" data-path="../server/hardware_requirement.html">
            
                <a href="../server/hardware_requirement.html">
            
                    
                        <b>1.5.14.</b>
                    
                    硬件要求
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.15" data-path="../server/upgrade.html">
            
                <a href="../server/upgrade.html">
            
                    
                        <b>1.5.15.</b>
                    
                    升级指南
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.16" data-path="../server/client_database_secret.html">
            
                <a href="../server/client_database_secret.html">
            
                    
                        <b>1.5.16.</b>
                    
                    客户端数据库密钥
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../android/">
            
                <a href="../android/">
            
                    
                        <b>1.6.</b>
                    
                    Android开发
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../android/compile.html">
            
                <a href="../android/compile.html">
            
                    
                        <b>1.6.1.</b>
                    
                    代码编译与工程说明
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../android/chatclient.html">
            
                <a href="../android/chatclient.html">
            
                    
                        <b>1.6.2.</b>
                    
                    ChatClient简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="../android/chatuikit.html">
            
                <a href="../android/chatuikit.html">
            
                    
                        <b>1.6.3.</b>
                    
                    ChatUIKit简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="../android/wildfirechat.html">
            
                <a href="../android/wildfirechat.html">
            
                    
                        <b>1.6.4.</b>
                    
                    WildfireChat简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.5" data-path="../android/push.html">
            
                <a href="../android/push.html">
            
                    
                        <b>1.6.5.</b>
                    
                    推送集成
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../ios/">
            
                <a href="../ios/">
            
                    
                        <b>1.7.</b>
                    
                    iOS开发
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../ios/compile.html">
            
                <a href="../ios/compile.html">
            
                    
                        <b>1.7.1.</b>
                    
                    代码编译与工程说明
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../ios/chatclient.html">
            
                <a href="../ios/chatclient.html">
            
                    
                        <b>1.7.2.</b>
                    
                    ChatClient简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="../ios/chatuikit.html">
            
                <a href="../ios/chatuikit.html">
            
                    
                        <b>1.7.3.</b>
                    
                    ChatUIKit简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.4" data-path="../ios/wildfirechat.html">
            
                <a href="../ios/wildfirechat.html">
            
                    
                        <b>1.7.4.</b>
                    
                    WildfireChat简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.5" data-path="../ios/push.html">
            
                <a href="../ios/push.html">
            
                    
                        <b>1.7.5.</b>
                    
                    推送集成
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../webrtc/">
            
                <a href="../webrtc/">
            
                    
                        <b>1.8.</b>
                    
                    音视频
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="../base_knowledge/maintain.html">
            
                <a href="../base_knowledge/maintain.html">
            
                    
                        <b>1.9.</b>
                    
                    维护说明
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10" >
            
                <a target="_blank" href="https://github.com/wildfirechat/im-app_server/blob/master/README.md">
            
                    
                        <b>1.10.</b>
                    
                    应用服务
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11" >
            
                <a target="_blank" href="https://github.com/wildfirechat/push_server/blob/master/README.md">
            
                    
                        <b>1.11.</b>
                    
                    推送服务
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12" >
            
                <a target="_blank" href="https://github.com/wildfirechat/robot_server/blob/master/README.md">
            
                    
                        <b>1.12.</b>
                    
                    机器人服务
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13" data-path="../faq/">
            
                <a href="../faq/">
            
                    
                        <b>1.13.</b>
                    
                    常见问题
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.13.1" data-path="../faq/general.html">
            
                <a href="../faq/general.html">
            
                    
                        <b>1.13.1.</b>
                    
                    通用问题
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.13.1.1" data-path="../faq/buy.html">
            
                <a href="../faq/buy.html">
            
                    
                        <b>1.13.1.1.</b>
                    
                    购买流程
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.13.2" data-path="../faq/server.html">
            
                <a href="../faq/server.html">
            
                    
                        <b>1.13.2.</b>
                    
                    服务器问题
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.13.2.1" data-path="../faq/server/q1.html">
            
                <a href="../faq/server/q1.html">
            
                    
                        <b>1.13.2.1.</b>
                    
                    如何导入到IDE中
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.2.2" data-path="../faq/server/q2.html">
            
                <a href="../faq/server/q2.html">
            
                    
                        <b>1.13.2.2.</b>
                    
                    如何解决等登陆但一直连接中的问题
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.13.3" data-path="../faq/android.html">
            
                <a href="../faq/android.html">
            
                    
                        <b>1.13.3.</b>
                    
                    安卓问题
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.13.3.1" data-path="../faq/android/q1.html">
            
                <a href="../faq/android/q1.html">
            
                    
                        <b>1.13.3.1.</b>
                    
                    如何导入到Android Studio中
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.3.2" data-path="../faq/android/q2.html">
            
                <a href="../faq/android/q2.html">
            
                    
                        <b>1.13.3.2.</b>
                    
                    如何集成到现有项目中
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.13.4" data-path="../faq/ios.html">
            
                <a href="../faq/ios.html">
            
                    
                        <b>1.13.4.</b>
                    
                    iOS问题
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.5" data-path="../faq/web.html">
            
                <a href="../faq/web.html">
            
                    
                        <b>1.13.5.</b>
                    
                    Web问题
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.6" data-path="../faq/practicality.html">
            
                <a href="../faq/practicality.html">
            
                    
                        <b>1.13.6.</b>
                    
                    最佳实践
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.13.6.1" data-path="../faq/practicality/stickers.html">
            
                <a href="../faq/practicality/stickers.html">
            
                    
                        <b>1.13.6.1.</b>
                    
                    小表情大世界
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.6.2" data-path="../faq/practicality/online_match.html">
            
                <a href="../faq/practicality/online_match.html">
            
                    
                        <b>1.13.6.2.</b>
                    
                    在线匹配
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.14" data-path="./">
            
                <a href="./">
            
                    
                        <b>1.14.</b>
                    
                    文章
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.14.1" data-path="如何开发一款微信.html">
            
                <a href="如何开发一款微信.html">
            
                    
                        <b>1.14.1.</b>
                    
                    如何开发一款微信
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.14.2" data-path="如何修改野火应用服务生成用户名的策略.html">
            
                <a href="如何修改野火应用服务生成用户名的策略.html">
            
                    
                        <b>1.14.2.</b>
                    
                    如何修改野火应用服务生成用户名的策略
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14.3" data-path="苹果ATS处理.html">
            
                <a href="苹果ATS处理.html">
            
                    
                        <b>1.14.3.</b>
                    
                    苹果ATS处理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14.4" data-path="野火IM的商业逻辑.html">
            
                <a href="野火IM的商业逻辑.html">
            
                    
                        <b>1.14.4.</b>
                    
                    野火IM的商业逻辑
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14.5" data-path="如何理解野火IM设计理念.html">
            
                <a href="如何理解野火IM设计理念.html">
            
                    
                        <b>1.14.5.</b>
                    
                    如何理解野火IM设计理念
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14.6" data-path="为什么野火IM不全免费.html">
            
                <a href="为什么野火IM不全免费.html">
            
                    
                        <b>1.14.6.</b>
                    
                    为什么野火IM不全免费
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14.7" data-path="开发运营社交软件也要遵守法律.html">
            
                <a href="开发运营社交软件也要遵守法律.html">
            
                    
                        <b>1.14.7.</b>
                    
                    开发运营社交软件也要遵守法律
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14.8" data-path="如何实现聊天记录的备份与恢复.html">
            
                <a href="如何实现聊天记录的备份与恢复.html">
            
                    
                        <b>1.14.8.</b>
                    
                    如何实现聊天记录的备份与恢复
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >如何修改野火应用服务生成用户名的策略</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <div id="anchor-navigation-ex-navbar"><i class="fa fa-anchor"></i><ul><li><a href="#&#x5982;&#x4F55;&#x4FEE;&#x6539;&#x91CE;&#x706B;&#x5E94;&#x7528;&#x670D;&#x52A1;&#x751F;&#x6210;&#x7528;&#x6237;&#x540D;&#x7684;&#x7B56;&#x7565;">&#x5982;&#x4F55;&#x4FEE;&#x6539;&#x91CE;&#x706B;&#x5E94;&#x7528;&#x670D;&#x52A1;&#x751F;&#x6210;&#x7528;&#x6237;&#x540D;&#x7684;&#x7B56;&#x7565;</a></li><ul><li><a href="#1-&#x91CE;&#x706B;im&#x7684;&#x51E0;&#x4E2A;&#x76F8;&#x5173;&#x6982;&#x5FF5;&#xFF1A;">1. &#x91CE;&#x706B;IM&#x7684;&#x51E0;&#x4E2A;&#x76F8;&#x5173;&#x6982;&#x5FF5;&#xFF1A;</a></li><li><a href="#2-&#x4FEE;&#x6539;&#x91CE;&#x706B;im-app-server">2. &#x4FEE;&#x6539;&#x91CE;&#x706B;IM App Server</a></li><li><a href="#3-&#x66F4;&#x65B0;&#x91CE;&#x706B;im&#x670D;&#x52A1;">3. &#x66F4;&#x65B0;&#x91CE;&#x706B;IM&#x670D;&#x52A1;</a></li><li><a href="#4-&#x5BA2;&#x6237;&#x7AEF;&#x641C;&#x7D22;&#x65F6;&#xFF0C;&#x6539;&#x4E3A;&#x7CBE;&#x786E;&#x641C;&#x7D22;">4. &#x5BA2;&#x6237;&#x7AEF;&#x641C;&#x7D22;&#x65F6;&#xFF0C;&#x6539;&#x4E3A;&#x7CBE;&#x786E;&#x641C;&#x7D22;</a></li><li><a href="#5-&#x663E;&#x793A;&#x81EA;&#x5DF1;&#x7684;&#x4FE1;&#x606F;&#x65F6;&#x663E;&#x793A;&#x7528;&#x6237;&#x540D;">5. &#x663E;&#x793A;&#x81EA;&#x5DF1;&#x7684;&#x4FE1;&#x606F;&#x65F6;&#x663E;&#x793A;&#x7528;&#x6237;&#x540D;</a></li><li><a href="#6-&#x663E;&#x793A;&#x522B;&#x4EBA;&#x7528;&#x6237;&#x4FE1;&#x606F;&#x65F6;&#xFF0C;&#x663E;&#x793A;&#x7528;&#x6237;&#x540D;">6. &#x663E;&#x793A;&#x522B;&#x4EBA;&#x7528;&#x6237;&#x4FE1;&#x606F;&#x65F6;&#xFF0C;&#x663E;&#x793A;&#x7528;&#x6237;&#x540D;</a></li><li><a href="#7-&#x6700;&#x540E;">7. &#x6700;&#x540E;</a></li></ul></ul></div><a href="#&#x5982;&#x4F55;&#x4FEE;&#x6539;&#x91CE;&#x706B;&#x5E94;&#x7528;&#x670D;&#x52A1;&#x751F;&#x6210;&#x7528;&#x6237;&#x540D;&#x7684;&#x7B56;&#x7565;" id="anchorNavigationExGoTop"><i class="fa fa-arrow-up"></i></a><h1 id="&#x5982;&#x4F55;&#x4FEE;&#x6539;&#x91CE;&#x706B;&#x5E94;&#x7528;&#x670D;&#x52A1;&#x751F;&#x6210;&#x7528;&#x6237;&#x540D;&#x7684;&#x7B56;&#x7565;"><a name="&#x5982;&#x4F55;&#x4FEE;&#x6539;&#x91CE;&#x706B;&#x5E94;&#x7528;&#x670D;&#x52A1;&#x751F;&#x6210;&#x7528;&#x6237;&#x540D;&#x7684;&#x7B56;&#x7565;" class="anchor-navigation-ex-anchor" href="#&#x5982;&#x4F55;&#x4FEE;&#x6539;&#x91CE;&#x706B;&#x5E94;&#x7528;&#x670D;&#x52A1;&#x751F;&#x6210;&#x7528;&#x6237;&#x540D;&#x7684;&#x7B56;&#x7565;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x5982;&#x4F55;&#x4FEE;&#x6539;&#x91CE;&#x706B;&#x5E94;&#x7528;&#x670D;&#x52A1;&#x751F;&#x6210;&#x7528;&#x6237;&#x540D;&#x7684;&#x7B56;&#x7565;</h1>
<p>&#x5728;&#x91CE;&#x706B;IM Demo&#x4E0A;&#xFF0C;&#x770B;&#x5230;&#x7528;&#x6237;&#x540D;&#x662F;&#x7535;&#x8BDD;&#x53F7;&#x7801;&#xFF0C;&#x5BB9;&#x6613;&#x6CC4;&#x6F0F;&#x9690;&#x79C1;&#xFF0C;&#x56E0;&#x6B64;demo&#x4E0A;&#x5C31;&#x628A;&#x7528;&#x6237;&#x540D;&#x9690;&#x85CF;&#x4E86;&#x3002;&#x6709;&#x5BA2;&#x6237;&#x95EE;&#x5982;&#x4F55;&#x6309;&#x7167;&#x81EA;&#x5DF1;&#x7684;&#x89C4;&#x5219;&#x751F;&#x6210;&#x7528;&#x6237;&#x540D;&#xFF0C;&#x5982;&#x4F55;&#x641C;&#x7D22;&#x4EC5;&#x4EC5;&#x5339;&#x914D;&#x7528;&#x6237;&#x540D;&#x3002;&#x8FD9;&#x91CC;&#x5C06;&#x4EE5;&#x8FD9;&#x4E2A;&#x5BA2;&#x6237;&#x4E3A;&#x4F8B;&#xFF0C;&#x8BB2;&#x4E00;&#x4E0B;&#x5982;&#x4F55;&#x5BF9;&#x91CE;&#x706B;IM&#x8FDB;&#x884C;&#x5B9A;&#x5236;&#x3002;&#x9996;&#x5148;&#x770B;&#x4E00;&#x4E0B;&#x5BA2;&#x6237;&#x539F;&#x59CB;&#x9700;&#x6C42;&#xFF1A;</p>
<blockquote>
<p>&#x7528;&#x6237;&#x6CE8;&#x518C;&#x751F;&#x6210;uid uid&#x4ECE;1&#x5F00;&#x59CB; &#x70B9;&#x51FB;&#x7528;&#x6237;&#x5934;&#x50CF;&#x65F6;&#x4F1A;&#x663E;&#x793A;&#x624B;&#x673A;&#x53F7;&#x7801; &#x5C06;&#x624B;&#x673A;&#x53F7;&#x7801;&#x6362;&#x6210;&#x73B0;uid &#x201C;&#x6211;&#x201D;&#x9875;&#x9762; &#x6635;&#x79F0;&#x4E0B;&#x9762;&#x663E;&#x793A;uid &#x53EA;&#x5141;&#x8BB8;&#x4F7F;&#x7528;uid&#x67E5;&#x627E;&#x6DFB;&#x52A0;&#x597D;&#x53CB; uid&#x5728;&#x5BA2;&#x6237;&#x7AEF;&#x663E;&#x793A;ID:1</p>
</blockquote>
<h2 id="1__&#x91CE;&#x706B;IM&#x7684;&#x51E0;&#x4E2A;&#x76F8;&#x5173;&#x6982;&#x5FF5;&#xFF1A;">1. 1. &#x91CE;&#x706B;IM&#x7684;&#x51E0;&#x4E2A;&#x76F8;&#x5173;&#x6982;&#x5FF5;&#xFF1A;</h2>
<p>&#x4E3A;&#x4E86;&#x907F;&#x514D;&#x6DF7;&#x6DC6;&#xFF0C;&#x9996;&#x5148;&#x9700;&#x8981;&#x8BF4;&#x660E;&#x5982;&#x4E0B;&#x51E0;&#x4E2A;&#x6982;&#x5FF5;</p>
<ul>
<li><p>&#x7528;&#x6237;ID&#xFF08;userId)
&#x6BCF;&#x4E2A;&#x7528;&#x6237;&#x90FD;&#x5728;&#x7CFB;&#x7EDF;&#x4E2D;&#x6709;&#x552F;&#x4E00;&#x4E00;&#x4E2A;ID&#xFF0C;&#x8FD9;&#x4E2A;ID&#x662F;&#x8FD9;&#x4E2A;&#x7528;&#x6237;&#x7684;&#x6807;&#x793A;&#xFF0C;&#x4E0D;&#x4F1A;&#x91CD;&#x590D;&#xFF0C;&#x4E5F;&#x4E0D;&#x53EF;&#x80FD;&#x8FDB;&#x884C;&#x53D8;&#x66F4;&#xFF0C;&#x5728;IM&#x7CFB;&#x7EDF;&#x4E2D;&#x6240;&#x6709;&#x7684;&#x4E8B;&#x52A1;&#x5904;&#x7406;&#x90FD;&#x662F;&#x4F9D;&#x636E;&#x8FD9;&#x4E2A;ID&#x8FDB;&#x884C;&#x7684;&#x3002;&#x8FD9;&#x4E2A;ID&#x8DDF;&#x5BA2;&#x6237;&#x9700;&#x8981;&#x91CC;&#x7684;&#x201C;&#x7528;&#x6237;ID&#x201D;&#x4E0D;&#x662F;&#x4E00;&#x4E2A;&#x6982;&#x5FF5;&#x3002;</p>
</li>
<li><p>&#x7528;&#x6237;&#x540D;&#xFF08;userName&#xFF09;
&#x7528;&#x6237;ID&#x5177;&#x6709;&#x4E0D;&#x53EF;&#x8BFB;&#x6027;&#xFF0C;&#x8FD9;&#x5C31;&#x9700;&#x8981;&#x4E00;&#x4E2A;&#x53EF;&#x8BFB;&#x7684;&#x552F;&#x4E00;&#x7684;&#x7528;&#x6237;&#x6807;&#x793A;&#xFF0C;&#x8FD9;&#x4E2A;&#x5C31;&#x662F;&#x7528;&#x6237;&#x540D;&#xFF0C;&#x8FD9;&#x4E2A;&#x540D;&#x5B57;&#x5728;&#x7CFB;&#x7EDF;&#x4E2D;&#x5177;&#x6709;&#x552F;&#x4E00;&#x6027;&#xFF0C;&#x7528;&#x6237;&#x53EF;&#x4EE5;&#x66F4;&#x6539;&#x7528;&#x6237;&#x540D;&#x3002;&#x8FD9;&#x4E2A;&#x7528;&#x6237;&#x540D;&#x5C31;&#x662F;&#x5BA2;&#x6237;&#x63D0;&#x5230;&#x7684;&#x201D;&#x7528;&#x6237;ID&#x201D;&#x3002;&#x5FAE;&#x4FE1;&#x4E2D;&#x5BF9;&#x5E94;&#x7684;&#x5C31;&#x662F;&#x201C;&#x5FAE;&#x4FE1;&#x53F7;&#x201D;&#xFF0C;&#x8FD9;&#x4E2A;&#x662F;&#x53EF;&#x4EE5;&#x66F4;&#x6539;&#x7684;&#xFF0C;&#x4F46;&#x4E00;&#x4E2A;&#x201D;&#x5FAE;&#x4FE1;&#x53F7;&#x201D;&#x53EA;&#x80FD;&#x5BF9;&#x5E94;&#x4E00;&#x4E2A;&#x7528;&#x6237;&#x3002;</p>
</li>
<li><p>&#x6635;&#x79F0;&#xFF08;displayName)
&#x8FD9;&#x4E2A;&#x5C31;&#x662F;&#x6635;&#x79F0;&#x4E86;&#xFF0C;&#x53EF;&#x4EE5;&#x968F;&#x4FBF;&#x6539;&#xFF0C;&#x53EF;&#x4EE5;&#x91CD;&#x590D;&#x3002;</p>
</li>
<li><p>&#x7535;&#x8BDD;&#x53F7;&#x7801;&#xFF08;mobile)
&#x7535;&#x8BDD;&#x53F7;&#x7801;&#x672C;&#x6765;&#x662F;&#x7528;&#x6237;&#x7684;&#x4E00;&#x4E2A;&#x666E;&#x901A;&#x5C5E;&#x6027;&#xFF0C;&#x4F46;&#x7531;&#x4E8E;&#x5177;&#x6709;&#x552F;&#x4E00;&#x6027;&#xFF0C;&#x6240;&#x4EE5;&#x5F88;&#x591A;&#x65F6;&#x5019;&#x4E5F;&#x4F5C;&#x4E3A;&#x7528;&#x6237;&#x6807;&#x793A;&#xFF0C;&#x5728;&#x91CE;&#x706B;IM&#x7684;demo&#x4E2D;&#x628A;&#x7528;&#x6237;ID&#x548C;mobile&#x90FD;&#x9ED8;&#x8BA4;&#x4E3A;&#x7535;&#x8BDD;&#x53F7;&#x7801;&#x4E86;&#x3002;&#x8FD9;&#x4E2A;&#x4F8B;&#x5B50;&#x5176;&#x4E2D;&#x5C31;&#x9700;&#x8981;&#x6539;&#x8FD9;&#x91CC;&#x7684;&#x903B;&#x8F91;&#x3002;</p>
</li>
</ul>
<p>&#x7EFC;&#x4E0A;&#x6240;&#x8BF4;&#xFF0C;&#x5BA2;&#x6237;&#x6240;&#x8BF4;&#x7528;&#x6237;ID&#x5C31;&#x662F;&#x91CE;&#x706B;IM&#x7CFB;&#x7EDF;&#x4E2D;&#x7684;&#x7528;&#x6237;&#x540D;&#xFF0C;&#x5BF9;&#x5E94;&#x5FAE;&#x4FE1;&#x7684;&#x201C;&#x5FAE;&#x4FE1;ID&#x201D;&#x3002;&#x4E0B;&#x9762;&#x5C31;&#x8BF4;&#x4E00;&#x4E0B;&#x600E;&#x4E48;&#x5904;&#x7406;&#x5427;&#x3002;</p>
<h2 id="2__&#x4FEE;&#x6539;&#x91CE;&#x706B;IM_App_Server">2. 2. &#x4FEE;&#x6539;&#x91CE;&#x706B;IM App Server</h2>
<p>&#x91CE;&#x706B;App Server&#x9700;&#x8981;&#x4FEE;&#x6539;&#x6E90;&#x7801;&#xFF0C;&#x8BF7;&#x4E0B;&#x8F7D;<code>0.29-1</code>&#x6216;&#x66F4;&#x65B0;&#x7684;&#x4EE3;&#x7801;&#x3002;&#x5728;<code>ServiceImpl</code>&#x5BF9;&#x8C61;&#x4E2D;&#xFF0C;&#x627E;&#x5230;<code>userNameGenerator</code>&#x53D8;&#x91CF;</p>
<pre class="language-"><code class="lang-java"><span class="token annotation punctuation">@Autowired</span>
<span class="token keyword">private</span> PhoneNumberUserNameGenerator userNameGenerator<span class="token punctuation">;</span>
</code></pre>
<p>&#x4FEE;&#x6539;&#x4E3A;</p>
<pre class="language-"><code class="lang-java"><span class="token annotation punctuation">@Autowired</span>
<span class="token keyword">private</span> OrderedIdUserNameGenerator userNameGenerator<span class="token punctuation">;</span>
</code></pre>
<p>&#x7136;&#x540E;&#x7F16;&#x8BD1;&#x6253;&#x5305;&#x5C31;&#x4FEE;&#x6539;&#x5B8C;&#x6210;&#x4E86;&#x3002;</p>
<blockquote>
<p>&#x8FD9;&#x4E2A;&#x4E24;&#x4E2A;&#x4E0D;&#x540C;&#x7684;&#x7528;&#x6237;&#x540D;&#x751F;&#x6210;&#x7B56;&#x7565;&#xFF0C;&#x65E7;&#x7684;&#x662F;&#x76F4;&#x63A5;&#x4F7F;&#x7528;&#x7535;&#x8BDD;&#x53F7;&#x7801;&#x4F5C;&#x4E3A;&#x7528;&#x6237;&#x540D;&#xFF0C;&#x65B0;&#x7684;&#x662F;&#x5728;&#x6570;&#x636E;&#x5E93;&#x4E2D;&#x63D2;&#x5165;&#x6570;&#x636E;&#x83B7;&#x53D6;&#x81EA;&#x589E;id&#xFF0C;&#x4F7F;&#x7528;&#x81EA;&#x589E;id&#x4F5C;&#x4E3A;&#x7528;&#x6237;&#x540D;&#x3002;&#x5BA2;&#x6237;&#x53EF;&#x4EE5;&#x6269;&#x5C55;&#x66F4;&#x9002;&#x5408;&#x81EA;&#x5DF1;&#x7684;&#x751F;&#x6210;&#x7B56;&#x7565;</p>
<p>App Server&#x9ED8;&#x8BA4;&#x4F7F;&#x7528;&#x7684;&#x662F;h2&#x6570;&#x636E;&#x5E93;&#xFF0C;&#x9002;&#x5408;&#x4E8E;&#x5F00;&#x53D1;&#xFF0C;&#x4E0A;&#x7EBF;&#x8981;&#x5207;&#x6362;&#x6210;mysql&#xFF0C;&#x5207;&#x6362;&#x65B9;&#x6CD5;&#x5728;&#x5E94;&#x7528;&#x7684;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x4E2D;&#x6709;&#x8BF4;&#x660E;&#x3002;</p>
</blockquote>
<h2 id="3__&#x66F4;&#x65B0;&#x91CE;&#x706B;IM&#x670D;&#x52A1;">3. 3. &#x66F4;&#x65B0;&#x91CE;&#x706B;IM&#x670D;&#x52A1;</h2>
<p>&#x91CE;&#x706B;IM&#x670D;&#x52A1;&#x5728;<code>0.29-1</code>&#x7248;&#x672C;&#x5BF9;&#x641C;&#x7D22;&#x7528;&#x6237;&#x8FDB;&#x884C;&#x4E86;&#x4FEE;&#x6539;&#x3002;&#x641C;&#x7D22;&#x7528;&#x6237;&#x6709;&#x4E2A;<code>fuzzy</code>&#x7684;&#x53C2;&#x6570;&#xFF0C;<code>fuzzy</code>&#x4E3A;1&#x65F6;&#xFF0C;&#x6A21;&#x7CCA;&#x641C;&#x7D22;&#x7528;&#x6237;&#x6635;&#x79F0;&#x7CBE;&#x786E;&#x641C;&#x7D22;&#x7528;&#x6237;&#x540D;&#x548C;&#x7535;&#x8BDD;&#x53F7;&#x7801;&#xFF1B;&#x4E3A;0&#x662F;&#x53EA;&#x7CBE;&#x786E;&#x641C;&#x7D22;&#x7528;&#x6237;&#x540D;&#x548C;&#x7535;&#x8BDD;&#x53F7;&#x7801;&#x3002;</p>
<h2 id="4__&#x5BA2;&#x6237;&#x7AEF;&#x641C;&#x7D22;&#x65F6;&#xFF0C;&#x6539;&#x4E3A;&#x7CBE;&#x786E;&#x641C;&#x7D22;">4. 4. &#x5BA2;&#x6237;&#x7AEF;&#x641C;&#x7D22;&#x65F6;&#xFF0C;&#x6539;&#x4E3A;&#x7CBE;&#x786E;&#x641C;&#x7D22;</h2>
<p>&#x9700;&#x8981;&#x5206;&#x522B;&#x5728;&#x5B89;&#x5353;&#x548C;iOS&#x5BA2;&#x6237;&#x7AEF;&#x8FDB;&#x884C;&#x4FEE;&#x6539;&#x3002;</p>
<p>&#x5B89;&#x5353;&#x7684;&#x4FEE;&#x6539;&#x5728;<code>UserSearchModule</code>&#x5BF9;&#x8C61;&#x4E2D;&#xFF0C;&#x628A;&#x7B2C;&#x4E8C;&#x4E2A;&#x53C2;&#x6570;&#x6539;&#x6210;<code>false</code></p>
<pre class="language-"><code class="lang-java">ChatManager<span class="token punctuation">.</span><span class="token function">Instance</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">searchUser</span><span class="token punctuation">(</span>keyword<span class="token punctuation">,</span> <span class="token boolean">true</span><span class="token punctuation">,</span> <span class="token keyword">new</span> <span class="token class-name">SearchUserCallback</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token annotation punctuation">@Override</span>
    <span class="token keyword">public</span> <span class="token keyword">void</span> <span class="token function">onSuccess</span><span class="token punctuation">(</span>List<span class="token generics function"><span class="token punctuation">&lt;</span>UserInfo<span class="token punctuation">&gt;</span></span> infos<span class="token punctuation">)</span> <span class="token punctuation">{</span>
        userInfos<span class="token punctuation">.</span><span class="token function">addAll</span><span class="token punctuation">(</span>infos<span class="token punctuation">)</span><span class="token punctuation">;</span>
        countDownLatch<span class="token punctuation">.</span><span class="token function">countDown</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>

    <span class="token annotation punctuation">@Override</span>
    <span class="token keyword">public</span> <span class="token keyword">void</span> <span class="token function">onFail</span><span class="token punctuation">(</span><span class="token keyword">int</span> errorCode<span class="token punctuation">)</span> <span class="token punctuation">{</span>
        countDownLatch<span class="token punctuation">.</span><span class="token function">countDown</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
<p>iOS&#x7684;&#x4FEE;&#x6539;&#x5728;<code>WFCUAddFriendViewController.m</code>&#x6587;&#x4EF6;&#x4E2D;&#xFF0C;&#x628A;&#x7B2C;&#x4E8C;&#x4E2A;&#x53C2;&#x6570;&#x6539;&#x4E3A;<code>NO</code></p>
<pre class="language-"><code>[[WFCCIMService sharedWFCIMService] searchUser:searchString
                                                 fuzzy:YES
                                               success:^(NSArray<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>WFCCUserInfo</span> <span class="token attr-name">*</span><span class="token punctuation">&gt;</span></span> *machedUsers) {
                                                   ...
                                               }
                                                 error:^(int errorCode) {
                                                     ...
                                                 }];
</code></pre><h2 id="5__&#x663E;&#x793A;&#x81EA;&#x5DF1;&#x7684;&#x4FE1;&#x606F;&#x65F6;&#x663E;&#x793A;&#x7528;&#x6237;&#x540D;">5. 5. &#x663E;&#x793A;&#x81EA;&#x5DF1;&#x7684;&#x4FE1;&#x606F;&#x65F6;&#x663E;&#x793A;&#x7528;&#x6237;&#x540D;</h2>
<p>&#x540C;&#x6837;&#x9700;&#x8981;&#x5206;&#x522B;&#x5728;&#x5B89;&#x5353;&#x548C;iOS&#x5BA2;&#x6237;&#x7AEF;&#x4FEE;&#x6539;&#x3002;</p>
<p>&#x5728;&#x5B89;&#x5353;&#x7684;<code>main_fragment_me.xml</code>&#x6587;&#x4EF6;&#x4E2D;&#xFF0C;&#x627E;&#x5230;<code>accountTextView</code>&#x63A7;&#x4EF6;&#xFF0C;&#x628A;&#x8FD9;&#x4E2A;&#x63A7;&#x4EF6;&#x7684;&#x5C5E;&#x6027;<code>android:visibility=&quot;gone&quot;</code>&#x8FD9;&#x4E00;&#x884C;&#x53BB;&#x6389;&#x3002;&#x6539;&#x6210;&#x5982;&#x4E0B;&#x6240;&#x793A;&#xFF1A;</p>
<pre class="language-"><code class="lang-xml"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>TextView</span>
    <span class="token attr-name"><span class="token namespace">android:</span>id</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>@+id/accountTextView<span class="token punctuation">&quot;</span></span>
    <span class="token attr-name"><span class="token namespace">android:</span>layout_width</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>wrap_content<span class="token punctuation">&quot;</span></span>
    <span class="token attr-name"><span class="token namespace">android:</span>layout_height</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>wrap_content<span class="token punctuation">&quot;</span></span>
    <span class="token attr-name"><span class="token namespace">android:</span>layout_marginTop</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>3dp<span class="token punctuation">&quot;</span></span>
    <span class="token attr-name"><span class="token namespace">android:</span>singleLine</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>true<span class="token punctuation">&quot;</span></span>
    <span class="token attr-name"><span class="token namespace">android:</span>text</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>@string/my_chat_account<span class="token punctuation">&quot;</span></span>
    <span class="token attr-name"><span class="token namespace">android:</span>textColor</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>@color/gray2<span class="token punctuation">&quot;</span></span>
    <span class="token attr-name"><span class="token namespace">android:</span>textSize</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>13sp<span class="token punctuation">&quot;</span></span>
    <span class="token punctuation">/&gt;</span></span>
<span class="token comment">&lt;!--                android:visibility=&quot;gone&quot; --&gt;</span>
<span class="token comment">&lt;!--                /&gt;--&gt;</span>
</code></pre>
<p>&#x5728;iOS&#x7684;<code>WFCMeTableViewCell.m</code>&#x6587;&#x4EF6;&#x4E2D;&#xFF0C;&#x628A;&#x4E0B;&#x9762;&#x9690;&#x85CF;<code>userNameLabel</code>&#x7684;&#x8BED;&#x53E5;&#x6CE8;&#x91CA;&#x6389;</p>
<pre class="language-"><code>- (UILabel *)userName {
    if (!_userName) {
        _userName = [[UILabel alloc] initWithFrame:CGRectMake(72, 48, [UIScreen mainScreen].bounds.size.width - 64, 20)];
        [_userName setFont:[UIFont systemFontOfSize:16]];
        _userName.textColor = [UIColor grayColor];
//        _userName.hidden = YES;
        [self.contentView addSubview:_userName];
    }
    return _userName;
}
</code></pre><h2 id="6__&#x663E;&#x793A;&#x522B;&#x4EBA;&#x7528;&#x6237;&#x4FE1;&#x606F;&#x65F6;&#xFF0C;&#x663E;&#x793A;&#x7528;&#x6237;&#x540D;">6. 6. &#x663E;&#x793A;&#x522B;&#x4EBA;&#x7528;&#x6237;&#x4FE1;&#x606F;&#x65F6;&#xFF0C;&#x663E;&#x793A;&#x7528;&#x6237;&#x540D;</h2>
<p>&#x540C;&#x6837;&#x9700;&#x8981;&#x5206;&#x522B;&#x5728;&#x5B89;&#x5353;&#x548C;iOS&#x5BA2;&#x6237;&#x7AEF;&#x4FEE;&#x6539;&#x3002;</p>
<p>&#x5728;&#x5B89;&#x5353;&#x7684;<code>UserInfoFragment</code>&#x5BF9;&#x8C61;&#x4E2D;&#xFF0C;&#x628A;&#x9690;&#x85CF;&#x7528;&#x6237;&#x540D;&#x7684;&#x8BED;&#x53E5;&#x6CE8;&#x91CA;&#x6389;&#xFF0C;&#x5982;&#x4E0B;&#x9762;&#x4EE3;&#x7801;&#x6240;&#x793A;&#xFF1A;</p>
<pre class="language-"><code class="lang-java"><span class="token keyword">private</span> <span class="token keyword">void</span> <span class="token function">setUserInfo</span><span class="token punctuation">(</span>UserInfo userInfo<span class="token punctuation">)</span> <span class="token punctuation">{</span>
        Glide<span class="token punctuation">.</span><span class="token function">with</span><span class="token punctuation">(</span><span class="token keyword">this</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">load</span><span class="token punctuation">(</span>userInfo<span class="token punctuation">.</span>portrait<span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">apply</span><span class="token punctuation">(</span><span class="token keyword">new</span> <span class="token class-name">RequestOptions</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">placeholder</span><span class="token punctuation">(</span>R<span class="token punctuation">.</span>mipmap<span class="token punctuation">.</span>avatar_def<span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">centerCrop</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">into</span><span class="token punctuation">(</span>portraitImageView<span class="token punctuation">)</span><span class="token punctuation">;</span>
        nameTextView<span class="token punctuation">.</span><span class="token function">setText</span><span class="token punctuation">(</span><span class="token string">&quot;&#x91CE;&#x706B;ID&quot;</span> <span class="token operator">+</span> userInfo<span class="token punctuation">.</span>name<span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token comment">//        nameTextView.setVisibility(View.GONE); //&#x6CE8;&#x91CA;&#x6389;&#x8FD9;&#x91CC;</span>
        nickyNameTextView<span class="token punctuation">.</span><span class="token function">setText</span><span class="token punctuation">(</span>userViewModel<span class="token punctuation">.</span><span class="token function">getUserDisplayName</span><span class="token punctuation">(</span>userInfo<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token keyword">if</span> <span class="token punctuation">(</span>ChatManager<span class="token punctuation">.</span><span class="token function">Instance</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">isMyFriend</span><span class="token punctuation">(</span>userInfo<span class="token punctuation">.</span>uid<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
            mobileTextView<span class="token punctuation">.</span><span class="token function">setText</span><span class="token punctuation">(</span><span class="token string">&quot;&#x7535;&#x8BDD;:&quot;</span> <span class="token operator">+</span> userInfo<span class="token punctuation">.</span>mobile<span class="token punctuation">)</span><span class="token punctuation">;</span>
            mobileTextView<span class="token punctuation">.</span><span class="token function">setVisibility</span><span class="token punctuation">(</span>View<span class="token punctuation">.</span>VISIBLE<span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span>
</code></pre>
<p>&#x5728;iOS<code>WFCUProfileTableViewController.m</code>&#x6587;&#x4EF6;&#x4E2D;&#xFF0C;&#x628A;&#x4E0B;&#x9762;&#x8FD9;&#x53E5;&#x8BDD;&#x6CE8;&#x91CA;&#x6389;</p>
<pre class="language-"><code>self.userNameLabel.hidden = YES;
</code></pre><h2 id="7__&#x6700;&#x540E;">7. 7. &#x6700;&#x540E;</h2>
<p>&#x8FD9;&#x6837;&#x4FEE;&#x6539;&#x5B8C;&#x540E;&#xFF0C;UI&#x5E03;&#x5C40;&#x4E0A;&#x8FD8;&#x9700;&#x8981;&#x7B80;&#x5355;&#x8C03;&#x6574;&#x4E00;&#x4E0B;&#xFF0C;UI&#x7684;&#x6E90;&#x7801;&#x90FD;&#x5728;&#xFF0C;&#x5982;&#x679C;&#x60F3;&#x8981;&#x52A0;&#x4EC0;&#x4E48;&#x4E1C;&#x897F;&#x4E5F;&#x53EF;&#x4EE5;&#x5F88;&#x5BB9;&#x6613;&#x5730;&#x529E;&#x5230;&#x3002;</p>
<footer class="page-footer"><span class="copyright">2018 &#xA9; wildfirechat.cn &#x4EAC;ICP&#x5907;18060403&#x53F7;-1 all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification">&#x8BE5;&#x6587;&#x4EF6;&#x4FEE;&#x8BA2;&#x65F6;&#x95F4;&#xFF1A;
2019-12-10 22:33:19
</span></footer><div id="anchors-navbar"><i class="fa fa-anchor"></i><ul><p><a href="#&#x5982;&#x4F55;&#x4FEE;&#x6539;&#x91CE;&#x706B;&#x5E94;&#x7528;&#x670D;&#x52A1;&#x751F;&#x6210;&#x7528;&#x6237;&#x540D;&#x7684;&#x7B56;&#x7565;">&#x5982;&#x4F55;&#x4FEE;&#x6539;&#x91CE;&#x706B;&#x5E94;&#x7528;&#x670D;&#x52A1;&#x751F;&#x6210;&#x7528;&#x6237;&#x540D;&#x7684;&#x7B56;&#x7565;</a></p><li><a href="#1__&#x91CE;&#x706B;IM&#x7684;&#x51E0;&#x4E2A;&#x76F8;&#x5173;&#x6982;&#x5FF5;&#xFF1A;">1. 1. &#x91CE;&#x706B;IM&#x7684;&#x51E0;&#x4E2A;&#x76F8;&#x5173;&#x6982;&#x5FF5;&#xFF1A;</a></li><li><a href="#2__&#x4FEE;&#x6539;&#x91CE;&#x706B;IM_App_Server">2. 2. &#x4FEE;&#x6539;&#x91CE;&#x706B;IM App Server</a></li><li><a href="#3__&#x66F4;&#x65B0;&#x91CE;&#x706B;IM&#x670D;&#x52A1;">3. 3. &#x66F4;&#x65B0;&#x91CE;&#x706B;IM&#x670D;&#x52A1;</a></li><li><a href="#4__&#x5BA2;&#x6237;&#x7AEF;&#x641C;&#x7D22;&#x65F6;&#xFF0C;&#x6539;&#x4E3A;&#x7CBE;&#x786E;&#x641C;&#x7D22;">4. 4. &#x5BA2;&#x6237;&#x7AEF;&#x641C;&#x7D22;&#x65F6;&#xFF0C;&#x6539;&#x4E3A;&#x7CBE;&#x786E;&#x641C;&#x7D22;</a></li><li><a href="#5__&#x663E;&#x793A;&#x81EA;&#x5DF1;&#x7684;&#x4FE1;&#x606F;&#x65F6;&#x663E;&#x793A;&#x7528;&#x6237;&#x540D;">5. 5. &#x663E;&#x793A;&#x81EA;&#x5DF1;&#x7684;&#x4FE1;&#x606F;&#x65F6;&#x663E;&#x793A;&#x7528;&#x6237;&#x540D;</a></li><li><a href="#6__&#x663E;&#x793A;&#x522B;&#x4EBA;&#x7528;&#x6237;&#x4FE1;&#x606F;&#x65F6;&#xFF0C;&#x663E;&#x793A;&#x7528;&#x6237;&#x540D;">6. 6. &#x663E;&#x793A;&#x522B;&#x4EBA;&#x7528;&#x6237;&#x4FE1;&#x606F;&#x65F6;&#xFF0C;&#x663E;&#x793A;&#x7528;&#x6237;&#x540D;</a></li><li><a href="#7__&#x6700;&#x540E;">7. 7. &#x6700;&#x540E;</a></li></ul></div><a href="#1__&#x91CE;&#x706B;IM&#x7684;&#x51E0;&#x4E2A;&#x76F8;&#x5173;&#x6982;&#x5FF5;&#xFF1A;" id="goTop"><i class="fa fa-arrow-up"></i></a>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="如何开发一款微信.html" class="navigation navigation-prev " aria-label="Previous page: 如何开发一款微信">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="苹果ATS处理.html" class="navigation navigation-next " aria-label="Next page: 苹果ATS处理">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"如何修改野火应用服务生成用户名的策略","level":"1.14.2","depth":2,"next":{"title":"苹果ATS处理","level":"1.14.3","depth":2,"path":"blogs/苹果ATS处理.md","ref":"blogs/苹果ATS处理.md","articles":[]},"previous":{"title":"如何开发一款微信","level":"1.14.1","depth":2,"path":"blogs/如何开发一款微信.md","ref":"blogs/如何开发一款微信.md","articles":[]},"dir":"ltr"},"config":{"plugins":["-lunr","-search","-highlight","-livereload","search-plus@^0.0.11","simple-page-toc@^0.1.1","github@^2.0.0","github-buttons@2.1.0","prism@^2.1.0","prism-themes@^0.0.2","anchors@^0.7.1","emphasize@^1.1.0","splitter@^0.0.8","tbfed-pagefooter@^0.0.1","expandable-chapters-small@^0.1.7","sectionx@^3.1.0","sitemap-general@^0.1.1","anchor-navigation-ex@0.1.8","favicon@^0.0.2","todo@^0.1.3","3-ba@^0.9.0","terminal@^0.3.2","alerts@^0.2.0","include-csv@^0.1.0","-sharing","sharing-plus@^0.0.2","include-codeblock@^3.0.2","navigator"],"styles":{"website":"styles/website.css","ebook":"styles/ebook.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"2018 © wildfirechat.cn 京ICP备18060403号-1","modify_label":"该文件修订时间：","modify_format":"YYYY-MM-DD HH:mm:ss"},"prism":{"css":["prism-themes/themes/prism-base16-ateliersulphurpool.light.css"]},"include-csv":{},"disqus":{"shortName":"gitbookuse"},"emphasize":{},"github":{"url":"https://github.com/wildfirechat/docs"},"simple-page-toc":{"maxDepth":3,"skipFirstH1":true},"todo":{},"splitter":{},"sharing-plus":{"qq":false,"all":["facebook","google","twitter","instapaper","linkedin","pocket","stumbleupon"],"douban":false,"facebook":true,"weibo":false,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":true,"messenger":false,"line":false,"vk":false,"pocket":true,"google":false,"viber":false,"stumbleupon":false,"qzone":false,"linkedin":false},"sitemap-general":{"prefix":"http://wildfirechat.cn"},"fontsettings":{"theme":"white","family":"sans","size":2},"sectionx":{"tag":"b"},"anchor-navigation-ex":{"isRewritePageTitle":false,"tocLevel1Icon":"fa fa-hand-o-right","tocLevel2Icon":"fa fa-hand-o-right","tocLevel3Icon":"fa fa-hand-o-right"},"favicon":{"shortcut":"favicon.ico","bookmark":"favicon.ico"},"prism-themes":{},"navigator":{},"alerts":{},"github-buttons":{"repo":"wildfirechat/server","types":["star"],"size":"small"},"3-ba":{"configuration":"auto","token":"ff100361cdce95dd4c8fb96b4009f7bc"},"expandable-chapters-small":{},"include-codeblock":{"check":false,"edit":true,"fixlang":false,"lang":"","template":"ace","theme":"chrome","unindent":true},"sharing":{"qq":true,"all":["facebook","google","twitter","weibo","instapaper","linkedin","pocket","stumbleupon","qq","qzone"],"douban":false,"facebook":false,"weibo":true,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":false,"messenger":false,"line":false,"vk":false,"pocket":false,"google":false,"viber":false,"stumbleupon":false,"qzone":false,"linkedin":true},"terminal":{"copyButtons":true,"fade":false,"style":"flat"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":true},"anchors":{},"search-plus":{}},"theme":"default","author":"野火IM","pdf":{"pageNumbers":true,"fontSize":9,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":45,"left":45,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"野火IM开发手册","links":{"sidebar":{"Home":"http://www.wildfirechat.cn"}},"gitbook":"*","description":"野火IM开发手册"},"file":{"path":"blogs/如何修改野火应用服务生成用户名的策略.md","mtime":"2019-12-10T14:33:19.820Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-12-10T15:11:58.061Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-search-plus/jquery.mark.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-plus/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-github/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-github-buttons/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.js"></script>
        
    
        
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sectionx/sectionx.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-3-ba/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-terminal/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-alerts/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing-plus/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

